
# PurlExt.pm: The Extension Manager for PurlMUSH.
#
#
# Extensions are non-required system enhancements designed to bring
# more functionality to a PurlMUSH system.
#
# Akin to Purl::Commands, PurlExt creates and manages a list of
# Loadable extensions, information about them, and how to handle them.

package PurlExt;

use strict;

# These should already be loaded at this point, but better safe then sorry.
use Purl::Commands;

sub import {
    Purl::Commands::register(
        name    => "\@module",
        authRef => \&Purl::tests::isWizard,
        subRef  => \&PurlExt::cmd_module,
    );

    
}

sub cmd_module {
    my %args = @_;

# print "DEBUG - cmd_commands - me=$args{actor}, text=$args{text}, arg2=$arg2\n";
    my $module = "use PurlExt::$args{text};";
    eval $module;
    Purl::comm::sendTextToPlayer(
        target => $args{actor},
        text   => "Loading Module: $args{text} from 'PurlExt::$args{text}'\n"
    );

}

1;
